/********************************************************************************
 * @file   gkt_compiler_armcc.h
 * @brief  ARMCC (ARM compiler V5) compiler header file
 * @date   8/Oct/2018
 ********************************************************************************/
 
#ifndef GKT_COMPILER_ARMCC_H
#define GKT_COMPILER_ARMCC_H

#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 400677)
#error "Please use ARM Compiler Toolchain V4.0.677 or later!"
#endif

#if ((defined (__TARGET_ARCH_6_M  ) && (__TARGET_ARCH_6_M   == 1)) || \
	(defined (__TARGET_ARCH_6S_M ) && (__TARGET_ARCH_6S_M  == 1))   )
#define __ARM_ARCH_6M__           1
#endif

#if (defined (__TARGET_ARCH_7_M ) && (__TARGET_ARCH_7_M  == 1))
#define __ARM_ARCH_7M__           1
#endif

#if (defined (__TARGET_ARCH_7E_M) && (__TARGET_ARCH_7E_M == 1))
#define __ARM_ARCH_7EM__          1
#endif

#ifndef __ASM
#define __ASM	__asm
#endif

#ifndef __INLINE
#define __INLINE	__inline
#endif

#ifndef __STATIC_INLINE
#define __STATIC_INLINE	static __inline
#endif

#ifndef __NO_RETURN
#define __NO_RETURN	__declspec(noreturn)
#endif

#ifndef __USED
#define __USED	__attribute__((used))
#endif

#ifndef	__WEAK
#define __WEAK	__attribute__((weak))
#endif

#ifndef __ALIAS
#define __ALIAS(x)	__attribute__((__alias__(#x)))
#endif

#ifndef	__UNALIGNED_UINT32
#define __UNALIGNED_UINT32(x)     (*((__packed uint32_t *)(x)))
#endif

#ifndef	__ALIGNED
#define __ALIGNED(x)	__attribute__((aligned(x)))
#endif

#ifndef	__PACKED
#define __PACKED	__attribute__((packed))
#endif

#ifndef	__PACKED_STRUCT
#define __PACKED_STRUCT	__packed struct
#endif

/* anonymous struct extention */
#pragma anon_unions

#endif	/* GKT_COMPILER_ARMCC_H */


